//
//  HeadView.m
//  ProJectB_1
//
//  Created by lanou3g on 16/8/16.
//  Copyright © 2016年 yangshukai. All rights reserved.
//

#import "HeadView.h"
#import "HeadListModel.h"

@implementation HeadView

- (void)setData:(HeadListModel *)model{
    [_coverImageView sd_setImageWithURL:[NSURL URLWithString:model.coverimg]];
    _descLabel.text = model.desc;
    _LabelHeight.constant = [self stringHeight:_descLabel.text];
    [_icon sd_setImageWithURL:[NSURL URLWithString:model.userinfo[@"icon"]]];
    _unameLabel.text = model.userinfo[@"uname"];
    
    
}

- (CGFloat)stringHeight:(NSString *)aString{
    CGRect temp = [aString boundingRectWithSize:CGSizeMake(355, 10000) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:15]} context:nil];
    return temp.size.height;
}
- (IBAction)ShouC:(id)sender {
    
    
}

@end
